<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #output{
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
        <input type="text" id="score">
        <input type="button" id="btn" value="评判">
        <div id="output"></div>


            <script>
                var scoreobj = document.getElementById('score');
                var btn = document.getElementById('btn');
                var output = document.getElementById('output');
                btn.onclick = function () {
                    var score = scoreobj.value;
                    console.log(typeof score)
                    var s =' ';
                   switch (score){
                       case 9:
                            s = '优秀';
                       break;
                       case '8':
                           s = '良好';
                           break;
                       default:



                   }






                    console.log(s);


                    output.innerHTML = s;
                }
            </script>
</body>
</html>